package com.hpxx.ylzswl.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;

/**
 * 自定义dialog基类
 * @author Administrator
 */
public class BaseDialog extends Dialog implements View.OnClickListener {

	public Context context;
	public LeaveMyDialogListener listener;

	public interface LeaveMyDialogListener {
		public void onClick(View view);
	}

	public BaseDialog(Context context) {
		super(context);
		this.context = context;
	}

	public BaseDialog(Context context, int theme, LeaveMyDialogListener listener) {
		super(context, theme);
		this.context = context;
		this.listener = listener;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setCancelable(false);
		this.setCanceledOnTouchOutside(true);
	}

	@Override
	public void onClick(View v) {
		listener.onClick(v);
	}
}
